<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="/js/jquery-1.7.2.min.js" type="text/javascript"></script>
   <script type="text/javascript">
		/*
        $(function () {

        $('input:text:first').focus();

        var $inp = $('input:text');

        $inp.bind('keydown', function (e) {

            var key = e.which;

            if (key == 13) {

                e.preventDefault();

                var nxtIdx = $inp.index(this) + 1;

                $(":input:text:eq(" + nxtIdx + ")").focus();

            }

        });

    });
*/
        function add(){
        	var i = $("#count").attr('value');
			$("#table2").append('<tr><td>JOBID' + i +':</td><td><input type = "text" name = "id_job[]" style="width:100px"/></td><td>Comment:</td><td><input type = "text" name = "comment[]" style="width:200px" /></td></tr>');
			$("#count").attr('value',(parseInt(i)+1));

        }
    </script>
</head>

<body style="font-family:Arial, Helvetica, sans-serif">
<h1>Repair Job Device Tracking System
  <br />
</h1>
<h3>Unfinished Job List</h3>
<?php if(!empty($this->scanList)){ $y = 1;?>

	<table border="1" cellspacing="1" cellpadding="5">
				<tr>
					<th>No.</th>
					<th>Job ID</th>
					<th>Customer Name</th>
					<th>Mobile</th>
				</tr>
		<?php 
		
		foreach ($this->scanList as $k => $v){?>
				<tr>
					<td><?php echo $y++;?></td>
					<td><?php echo $v['id_job']?></td>
					<td><?php echo $v['customer_name']?></td>
					<td><?php echo $v['mobile_model']." ".$v['mobile_color']?></td>
				</tr>
<?php 		}
	  }?>
</table>
<br/><br/>
<?php if(empty($this->jobList)){$i= 1;?>
<input type = "hidden" id = "count" value = "2"></input>
Scan Job ID One By One<br />
<input type = "submit" id = "add" value = "+" onclick = "add()"></input>
<form id="form1" name="form1" method="post" action="">
<table width="500" border="1" cellspacing="0" cellpadding="10" id = "table2">
<tr>
	<td>JOBID<?php echo $i++?>:</td>
	<td><input type="text" name="id_job[]" style="width:100px" tabindex="1" /></td>
	<td>Comment:</td>
	<td><input type = "text" name = "comment[]" style="width:200px" /></td>
</tr>
  


</table>
Receiver Attendance Password:<input type="password" name = "password" ></input> 
<input type="submit" name="button" id="button" value="Confirm Scan Job ID" />
</form>
<?php }else{?>	  
<table width="700" border="1" cellspacing="0" cellpadding="10">
  <tr>
    <th scope="col">NO</th>
    <th scope="col">JOB ID</th>
    <th scope="col">Pickup By</th>
    <th scope="col">In Shop</th>
    <th scope="col">Comment</th>
  </tr>
  
<?php 

foreach($this->jobList as $k => $v){
?>	  
  <tr>
    <td><?php echo $k + 1;?></td>
    <td><?php echo $v['jobId']?></td>
    <td><?php echo $this->staffName;?></td>
    <td><?php echo $v['shop']?></td>
    <td><?php echo $v['comment']?></td>
  </tr>
<?php }?>
</table>
<?php }?>
<br />
</body>
</html>
